import request from "@/utils/axios";

// API接口定义
const Api = {
  ReportDailyPage: "/report/daily/query",
} as const;

// 搜索请求参数
export interface ReportDailySearchReq {
  startDate?: string; // 开始时间（UTC+0格式）
  endDate?: string; // 结束时间（UTC+0格式）
  pageIndex: number; // 页码
  pageSize: number; // 每页大小
}

// 分页响应数据
export interface ReportDailyPageRes {
  hasNextPage: boolean;
  list: ReportDailyRecordDto[];
  nextPage: number;
  count: number;
  total: number;
  size: number;
}
// 封禁记录数据
export interface ReportDailyRecordDto {
  id: string;
  reportDate: string | null;
  newUserCount: number;
  newUserRechargeAmount: number;
  dailyRechargeAmount: number;
  dailyRechargeCoin: number;
  newGuildCount: number;
  activeUserCount: number;
  luckyGiftInputCoin: number;
  luckyGiftReturnCoin: number;
  luckyGiftRoi: number;
  status: number;
  remark: string | null;
}

// 封禁状态枚举
export const ReportDailyStatus = {
  0: "danger", // 设置为danger类型，显示红色
  1: "success", // 其他状态保持不变
  2: "warning",
};
// 封禁状态文本映射
export const ReportDailyStatusText = {
  0: "未统计",
  1: "已统计",
  2: "统计中",
} as const;

// 获取封禁记录分页列表
export const getReportDailyPageApi = (data: ReportDailySearchReq) => {
  return request.post<ReportDailyPageRes>(Api.ReportDailyPage, data);
};
